package com.softserveinc.moviedbapp.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.softserveinc.moviedbapp.manager.DataManager;

/* receives messages when there's changes in network state */
public class SDCardMountedReceiver extends BroadcastReceiver {

	private DataManager mDataManager;
	private String TAG = SDCardMountedReceiver.class.getSimpleName();

	public SDCardMountedReceiver(final DataManager dm) {
		mDataManager = dm;
	}

	@Override
	public void onReceive(final Context context, final Intent intent) {

		Log.i(TAG, "Storage " + intent.getData());
		/* update current cache dir, because sd card state changed */
		mDataManager.getCacheManager().setCurrentCacheDir();

	}
}
